package com.LachesismStorm.lachesism.member.config;

import com.LachesismStorm.lachesism.core.config.swagger.BaseSwagger3Config;
import com.LachesismStorm.lachesism.core.config.swagger.SwaggerProperties;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.oas.annotations.EnableOpenApi;

/**
 * 功能描述
 *
 * @author: juiet
 * @date: 2022年05月28日 16:26
 */
@Configuration
@EnableOpenApi
public class Swagger3Config extends BaseSwagger3Config {

    @Value("${swagger3.enable}")
    private Boolean enableSwagger;
    @Value("${swagger3.title}")
    private String title;
    @Value("${swagger3.description}")
    private String description;
    @Value("${swagger3.authHeaderKey}")
    private String authHeaderKey;
    @Value("${swagger3.serviceUrl}")
    private String serviceUrl;
    @Value("${swagger3.contactVersion}")
    private String contactVersion;
    @Value("${swagger3.groupName}")
    private String groupName;

    @Override
    public SwaggerProperties swaggerProperties() {
        return SwaggerProperties.builder()
                .title(title)
                .description(description)
                .contactName("Lachesism")
                .version(contactVersion)
                .enableSecurity(true)
                .enableSwagger(enableSwagger)
                .groupName(groupName)
                .regexPath("/*")
                .enableSecurity(true)
                .build();
    }

}
